<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Process.h</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Process.h"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Process_h rootpage-Process_h skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main">process.h</span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p><b>process.h</b> is the C <a href="Header_file" class="mw-redirect" title="Header file">header file</a> which contains function declarations and macros used in working with threads and processes. Most C compilers that target <a href="DOS" title="DOS">DOS</a>, <a href="Windows_3.1x" class="mw-redirect" title="Windows 3.1x">Windows 3.1x</a>, <a href="Win32" class="mw-redirect" title="Win32">Win32</a>, <a href="OS/2" title="OS/2">OS/2</a>, Novell NetWare or <a href="DOS_extender" title="DOS extender">DOS extenders</a> supply this header and the library functions in their C library. Neither the header file nor most of the functions are defined by either the <a href="ANSI_C" title="ANSI C">ANSI/ISO C</a> standard or by <a href="POSIX" title="POSIX">POSIX</a>.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="History">History</h2></div>
<p>Microsoft's version of the file dates back to at least 1985, according to its copyright statement.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> An early reference to the file was in a post on the net.micro.pc usenet on Oct-26-1986.<sup id="cite_ref-msft_process.h_2-0" class="reference"><a href="#cite_note-msft_process.h-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> The compiler used was <a href="Microsoft_C_compiler" class="mw-redirect" title="Microsoft C compiler">Microsoft C compiler</a> version 3.0.
The <a href="Lattice_C" title="Lattice C">Lattice C</a> compiler version 3.30 (Aug-24-1988) did not have such a header file, but offered similar functions.
Borland provided the header in their <a href="Turbo_C" title="Turbo C">Turbo C</a> compiler version 2.01.
The C Ware-Personal C compiler version 1.2c (June 1989) had only the ANSI headers.
</p>
<div class="mw-heading mw-heading2"><h2 id="Functions">Functions</h2></div>
<table class="wikitable">
<tbody><tr>
<th>Name</th>
<th>Description</th>
<th>Notes
</th></tr>
<tr>
<td><code><a href="Exec_(operating_system)" class="mw-redirect" title="Exec (operating system)">execl, execle, execlp, execlpe</a></code></td>
<td>load and <a href="Execution_(computers)" class="mw-redirect" title="Execution (computers)">execute</a> a new child process by placing it in memory previously occupied by the parent process. Parameters are passed individually.</td>
<td>DOS, Win, OS/2, POSIX
</td></tr>
<tr>
<td><code><a href="Exec_(operating_system)" class="mw-redirect" title="Exec (operating system)">execv, execve, execvp, execvpe</a></code></td>
<td>load and execute a new child process by placing it in memory previously occupied by the parent process. Parameters are passed as an array of pointers.</td>
<td>DOS, Win, OS/2, POSIX
</td></tr>
<tr>
<td><code><a href="Spawn_(computing)" title="Spawn (computing)">spawnl, spawnle, spawnlp, spawnlpe</a></code></td>
<td>load and execute a new child process. Parameters are passed individually.</td>
<td>DOS, Win, OS/2
</td></tr>
<tr>
<td><code><a href="Spawn_(computing)" title="Spawn (computing)">spawnv, spawnve, spawnvp, spawnvpe</a></code></td>
<td>load and execute a new child process. Parameters are passed as an array of pointers.</td>
<td>DOS, Win, OS/2
</td></tr>
<tr>
<td><code>beginthread, beginthreadNT</code></td>
<td>creates a new thread of execution within the current process.</td>
<td>Win, OS/2
</td></tr>
<tr>
<td><code>endthread</code></td>
<td>terminates a thread created by <code>beginthread</code>.</td>
<td>Win, OS/2
</td></tr>
<tr>
<td><code><a href="Getpid" class="mw-redirect" title="Getpid">getpid</a></code></td>
<td>returns the <a href="Process_identifier" title="Process identifier">process identifier</a>.</td>
<td>DOS, Win, OS/2
</td></tr>
<tr>
<td><code>cexit</code></td>
<td>restore interrupt vectors altered by the startup code.</td>
<td>DOS, Win, OS/2
</td></tr>
</tbody></table>
<div class="mw-heading mw-heading2"><h2 id="Constants">Constants</h2></div>
<table class="wikitable">
<tbody><tr>
<th>Name</th>
<th>Description</th>
<th>Notes</th>
<th>OS
</th></tr>
<tr>
<td><code>_P_WAIT</code></td>
<td>Suspends parent process until the child process has finished executing.</td>
<td>synchronous spawn.</td>
<td>MS-DOS, Win32, OS/2
</td></tr>
<tr>
<td><code>_P_NOWAIT, _P_NOWAITO</code></td>
<td>Continues to execute calling process concurrently with new process.</td>
<td>asynchronous spawn.</td>
<td>Win32, OS/2
</td></tr>
<tr>
<td><code>_P_OVERLAY</code></td>
<td>Overlays parent process with child, which destroys the parent.</td>
<td>has the same effect as the <code>exec*</code> functions.</td>
<td>MS-DOS, Win32, OS/2
</td></tr>
<tr>
<td><code>_P_DETACH</code></td>
<td>The child is run in background without access to the console or keyboard.</td>
<td>Calls to <code>_cwait</code> upon the new process will fail. Asynchronous spawn.</td>
<td>Win32, OS/2
</td></tr>
<tr>
<td><code>_WAIT_CHILD</code></td>
<td>used as <code>cwait</code> action.</td>
<td>Obsolete on Win32.</td>
<td>MS-DOS, OS/2
</td></tr>
<tr>
<td><code>_WAIT_GRANDCHILD</code></td>
<td>used as <code>cwait</code> action.</td>
<td>Obsolete on Win32.</td>
<td>MS-DOS, OS/2
</td></tr></tbody></table>
<div class="mw-heading mw-heading2"><h2 id="Implementations">Implementations</h2></div>
<p>Given the fact there is no standard on which to base the implementation, the functions declared by process.h differ, depending on the compiler in use. Below is a list of compilers which provide process.h.
</p>
<ul><li>DJGPP<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-djgpp_process.h_4-0" class="reference"><a href="#cite_note-djgpp_process.h-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup></li>
<li>OpenWatcom,<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-watcom_clib_6-0" class="reference"><a href="#cite_note-watcom_clib-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup></li>
<li>Digital Mars<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-mars_process.h_8-0" class="reference"><a href="#cite_note-mars_process.h-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup></li>
<li>MinGW<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup></li>
<li>Microsoft Visual C++<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup></li>
<li>Borland Turbo C, 2.0 and later<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-turboc_2.0_12-0" class="reference"><a href="#cite_note-turboc_2.0-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup></li>
<li>Lcc32<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup></li>
<li>QNX Neutrino QCC 6.x<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Differences">Differences</h2></div>
<p>Another aspect that might vary is the combined length of exec* and spawn* parameters.
</p>
<ul><li>Delorie DJGPP: does not have such a limit.<sup id="cite_ref-djgpp_spawn_15-0" class="reference"><a href="#cite_note-djgpp_spawn-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup></li>
<li>Digital Mars: the maximum is 128 bytes; nothing is stated about the ending '\0' character.</li>
<li>Microsoft cl: the argument list for the new process must not exceed 1024 bytes.<sup id="cite_ref-msdn_16-0" class="reference"><a href="#cite_note-msdn-16"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text">"Copyright 1985–1989, Microsoft Corporation", in <a href="QuickC" title="QuickC">QuickC</a> version 2.00 process.h file</span>
</li>
<li id="cite_note-msft_process.h-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-msft_process.h_2-0">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://groups-beta.google.com/group/net.micro.pc/browse_frm/thread/b85ef1946a4915e6/1154bb52be4d5854?lnk=st&q=%22process%5C.h%22&rnum=23#1154bb52be4d5854">Is my floppy diskette formated?</a>, groups-beta.google.com</span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.delorie.com/djgpp/">Delorie.com</a></span>
</li>
<li id="cite_note-djgpp_process.h-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-djgpp_process.h_4-0">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.delorie.com/djgpp/doc/incs/process.h">DJGPP process.h</a>, delorie.com</span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.openwatcom.org/index.php/Main_Page">Openwatcom.org</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20150317091931/http://www.openwatcom.org/index.php/Main_Page">Archived</a> 2015-03-17 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a></span>
</li>
<li id="cite_note-watcom_clib-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-watcom_clib_6-0">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.openwatcom.org/ftp/manuals/clib.pdf">OpenWatcom clib</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20061011042009/http://www.openwatcom.org/ftp/manuals/clib.pdf">Archived</a> 2006-10-11 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a>, openwatcom.org</span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.digitalmars.com/">DigitalMars.com</a></span>
</li>
<li id="cite_note-mars_process.h-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-mars_process.h_8-0">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.digitalmars.com/rtl/process.html">Digital Mars process.h</a>, digitalmars.com</span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.mingw.org/">MinGW.org</a></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20070707082306/http://msdn.microsoft.com/vstudio/express/visualc/default.aspx">"MSDN.Microsoft.com"</a>. Archived from <a rel="nofollow" class="external text" href="http://msdn.microsoft.com/vstudio/express/visualc/default.aspx">the original</a> on 2007-07-07<span class="reference-accessdate">. Retrieved <span class="nowrap">2007-01-15</span></span>.</cite></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20121105211827/http://www.borland.com/">"Borland.com"</a>. Archived from <a rel="nofollow" class="external text" href="http://www.borland.com/">the original</a> on 2012-11-05<span class="reference-accessdate">. Retrieved <span class="nowrap">2007-01-15</span></span>.</cite></span>
</li>
<li id="cite_note-turboc_2.0-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-turboc_2.0_12-0">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://archive.today/20110710191522/http://dn.codegear.com/article/20841Turbo">C version 2.01</a>, dn.codegear.com</span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.cs.virginia.edu/~lcc-win32/">CS.Virginia.edu</a></span>
</li>
<li id="cite_note-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-14">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.qnx.com/products/neutrino_rtos/">QNX.com</a></span>
</li>
<li id="cite_note-djgpp_spawn-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-djgpp_spawn_15-0">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.delorie.com/djgpp/doc/libc/libc_736.html">DJGPP spawn*</a>, delorie.com</span>
</li>
<li id="cite_note-msdn-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-msdn_16-0">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt_system.2c_._wsystem.asp">Microsoft MSDN</a>, msdn.microsoft.com</span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="http://www.digitalmars.com/rtl/process.html#_exec">Digital Mars _exec reference</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-07-19" href="https://en.wikipedia.org/wiki/?title=Process.h&oldid=1301358483">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>